<?php session_start();
						
include_once ('core/conn.php');
						
$db = get_conn();
						
check_session();
						
if($_GET['id'] != ''){
	$sql = " select * from contenido where id_contenido=".$_GET['id']; 
	$result = mysql_query($sql);	
	if($result){
		$row = mysql_fetch_array($result);
		$id_contenido = $row['id_contenido'];
		$label = $row['label'];
		$texto = $row['texto'];
		$texto2 = $row['texto2'];
		$texto3 = $row['texto3'];
		$categoria = $row['categoria'];	
	}else{
		error_handling($sql,mysql_error());
	}
}
?>
<html>
<head>
<script>
					
<!--
						
	function checkdata(obj){
							
			
							
		if(obj.label.value ==''){
								
			alert('Debe indicar la descripcion');
								
			obj.label.focus();
								
			return false;
							
		}

	return true;
						
	}
					
-->
					
</script>
<style type="text/css">
<!--
body form table tr td table {
	text-align: left;
}
.titulo_modulo {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 14px;
	font-style: italic;
	text-transform: capitalize;
	text-decoration: none;
}
-->
</style>
<link href="css/admin_styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form name='contenido' method='post' action='/core/content_manager.php' onsubmit='return checkdata(this)'>
  <table width='100%' border='0'>
    <tr>
      <td valign='top' align="center" ><h2>Content Manager</h2></td>
    </tr>
    <tr>
      <td valign='top'><table width='100%' border='0'>
          <tr>
            <td width="49" align='left'><?php if($id_contenido!=''){ echo "ID: ".$id_contenido;}?></td>
            <td width="1505" align='left'>&nbsp;<input type='hidden' name='id_contenido' value="<? echo $id_contenido;?>" /></td>
          </tr>
          <tr>
            <td   align='left'>Name/Tag:</td>
            <td  align='left'><input name='label' type='text' value="<? echo $label;?>" size="30" /></td>
          </tr>
          <tr>
            <td colspan='2' align='left'><table width="100%" border="0">
                <tr>
                  <td>Default</td>
                </tr>
                <tr>
                  <td><textarea name="texto" cols="80" rows="5"  ><? echo $texto;?></textarea></td>
                </tr>
                <tr>
                  <td>Francais</td>
                </tr>
                <tr>
                  <td><textarea name="texto2" cols="80" rows="5" ><? echo $texto2;?></textarea></td>
                </tr>
                <tr>
                  <td>English</td>
                </tr>
                <tr>
                  <td><textarea name="texto3" cols="80" rows="5" ><? echo $texto3;?></textarea></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td colspan='2' style="text-align:center"><?
							  
					if ($_GET['id'] != ""){
								
						echo "<input type='submit' name='Actualizar' value='Save'>";
								
						echo "<input type='submit' name='Eliminar' value='Delete'>";										
								
						echo "<input type='submit' name='Nuevo' value='Create New'>";
						
						echo "<input type='Button' name='Cancel' value='Cancel' onClick=\"document.location.href='content_manager_list.php'\">";
							  
					}else{
								
						echo "<input type='submit' name='Agregar' value='Save'>";
						echo "<input type='Button' name='Cancel' value='Cancel' onClick=\"document.location.href='content_manager_list.php'\">";						
							  
					}
							 
					?></td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
</body>
</html>